package com.epoint.mobileoa.bizlogic.mobileoa;

import java.util.HashMap;

import android.os.Message;

import com.epoint.mobileoa.bizlogic.SuperView;
import com.epoint.mobileoa.bizlogic.Task;
import com.epoint.mobileoa.datanalysis.XMLHelp;
import com.epoint.mobileoa.http.HttpHelp;
import com.epoint.mobileoa.service.MainService;
import com.epoint.mobileoa.tools.StringHelp;
import com.epoint.mobileoa.ui.todolist.TodolistView;

/**
 * @author liyc
 * @time 2012-2-22 上午8:49:11
 * @annotation 
 */
public class GetArchiveListTask extends Task {

	/**
	 * @param con
	 * @param param
	 */
	public GetArchiveListTask(SuperView con, HashMap<String, Object> param) {
		super(con, param);
		
	}

	@Override
	public void exectue(Message mess) throws Exception {
		Integer pagenum = (Integer) getParam().get("pagenum");
		Integer shownum = (Integer)getParam().get("shownum");
		String seamurl = getCon().fp.getSeamurl()+"?requestType=GetArchiveList&userguid="+getCon().fp.getUserguid()+"&index="+pagenum+"&shownum="+shownum;
		String bs = HttpHelp.getHttpBack(seamurl);
		MainService.check_bs(bs);
		TodolistView.allArchiveNums = Integer.parseInt(StringHelp.getXMLAtt(bs, "allnum"));
		String archivebs = "<root>"+StringHelp.getXMLAtt(bs, "archives")+"</root>";
		setMessageToRefreshUI(mess, getCon(), XMLHelp.ArchiveListAna(archivebs));
	}

}
